﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace BAR_POS
{
    public partial class BeverageDatabaseScreen : DevExpress.XtraEditors.XtraUserControl
    {
        public BeverageDatabaseScreen()
        {
            InitializeComponent();
            memoEdit1.BackColor = this.BackColor;
        }

        private void BeverageDatabaseScreen_Load(object sender, EventArgs e)
        {
            dataGridView1.DataSource = DataTableClass.BeverageDatabase;
        }

        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            //MessageBox.Show(dataGridView1.SelectedCells[0].Value.ToString());

            foreach (DataRow item in DataTableClass.BeverageDatabase.Rows)
            {
                if (item["Name"].ToString().Trim() == dataGridView1.SelectedCells[0].Value.ToString().Trim())
                {
                    labelControl1.Text = item["Name"].ToString().Trim();
                    labelControl2.Text = item["Ingredients"].ToString().Trim();
                    memoEdit1.Text = item["Directions"].ToString().Trim();

                }
            }
        }
    }
}
